package com.remoter.basic.registry;

import java.io.Closeable;
import java.util.List;

import com.remoter.basic.bean.support.ConsumerModule;
import com.remoter.basic.bean.support.ProviderModule;
import com.remoter.basic.util.ServiceLoader.SPI;

/**
 * @author			koko
 * @date 			2017-08-08 14:06:30
 * @description 	类功能说明
 */
@SPI
public interface IRegistry extends Closeable{
	
	public boolean attachProvider(ProviderModule providerModule);
	public boolean attachConsumer(ConsumerModule consumerModule);
	
	public boolean detachProvider(ProviderModule providerModule);
	public boolean detachConsumer(ConsumerModule consumerModule);
	
	public boolean updateConsumer(ConsumerModule oldConsumerModule,ConsumerModule newConsumerModule);
	
	public boolean attachProviderListener(IRegistryProviderListener registryProviderListener);
	public boolean attachConsumerListener(IRegistryConsumerListener registryConsumerListener);
	
	public List<ProviderModule> listProviders();
	public List<ConsumerModule> listConsumers();
	
}